﻿Imports QLPhuTungOto.Data
Imports QLPhuTungOto.Bus
Public Class frmThemXe

    Dim Xe_BUS As New XeBUS

    Private Sub btnHuy_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnHuy.Click
        Close()
    End Sub

    Private Sub ThemXe()
        Dim xe As New Xe With {.TenXe = txtTenXe.Text}
        Xe_BUS.ThemXe(xe)
    End Sub

    Private Sub btnThemLoaiXe_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnThemLoaiXe.Click

        If txtTenXe.Text.Trim.Length <> 0 Then
            Try
                ThemXe()
                TrangThai.ThayDoiXe()
                Close()
            Catch ex As Exception
                MessageBox.Show("Không thể thêm xe", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error)
            End Try
        End If

    End Sub
End Class